<template>
  <div class="box">
    <!-- <el-row> -->
    <!-- <i class="el-icon-edit"> 房产经纪</i> -->
    <div class="tital">
      <span class="el-icon-s-promotion"></span>
      房产经纪
    </div>
    <!-- </el-row> -->
    <el-card
      v-for="item in agentsList"
      :key="item.id"
      class="box-card clearfix"
    >
      <el-row type="flex" justify="space-around">
        <el-col :span="6" class="card-left">
          <img :src="item.image" alt="" />
        </el-col>
        <el-col :span="18" class="card-right">
          <h2>{{ item.name }}</h2>
          <p>{{ item.desc }}</p>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import { getList } from './agents-api'
export default {
  data () {
    return {
      agentsList: []
    }
  },
  async created () {
    this.getAgentsList()
  },
  methods: {
    async getAgentsList () {
      const res = await getList()
      this.agentsList = res.data
      console.log(this.agentsList)
    }
  }
}
</script>

<style lang="less" scoped>
.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}

.box {
  padding-top: 70px;
  width: 1130px;
  // height: 100vh;
  margin: 0 auto;
  // background: hsla(0, 0%, 100%, 0.467);
  background: #fff;

  .tital {
    color: #e6a23c;
    font-size: 24px;
    // margin-left: 50px;
   padding: 20px;
    background: #fff;
  }
  .box-card {
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.56);;
    // height: 170px;
    // background: grey;
    .card-left {
      width: 150px;
      height: 150px;
      line-height: 150px;
      // background: pink;
      display: block;
      position: relative;
      img {
        position: static;
        width: 100%;
        position: absolute;
        transform: translate(-50%, -50%);
        left: 50%;
        top: 50%;
      }
    }

    .card-right {
      text-align: center;
      // background: blue;
      h2 {
        text-align: center;
        margin-bottom: 8px;
      }
      p {
        // text-indent: 2em;
        padding: 3px;
      }
    }
  }
}
</style>
